﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using WPFCustomControls.common;
using WPFCustomControls.core;

namespace WPFCustomControls
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();

            this.lbControl.SelectionChanged += LbControl_SelectionChanged;

            int rn = LS_App.Init(this.pageFrame);
        }

        private void LbControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListBoxItem listBoxItem = ((sender as ListBox).SelectedItem as ListBoxItem);
            string value = listBoxItem.Content.ToString();

            switch(value)
            {
                case "IconButton":
                    LS_App.pageManager.Navigate(PageEnum.IconButtonPage);
                    break;
                case "ComboBox":
                    LS_App.pageManager.Navigate(PageEnum.ComboBoxPage);
                    break;
                case "ColorPicker":
                    LS_App.pageManager.Navigate(PageEnum.ColorPickerPage);
                    break;
                case "GifImage":
                    LS_App.pageManager.Navigate(PageEnum.GifImagePage);
                    break;
                case "RealTimeChart":
                    LS_App.pageManager.Navigate(PageEnum.RealTimeChart);
                    break;
                case "CloudChart":
                    LS_App.pageManager.Navigate(PageEnum.CloudChart);
                    break;
                case "DataGridPager":
                    LS_App.pageManager.Navigate(PageEnum.DataGridPager);
                    break;
                case "ProgressRingWin":
                    LS_App.pageManager.Navigate(PageEnum.ProgressRingWinPage);
                    break;
                default:
                    break;
            }
        }
    }
}
